﻿using NicoView.Model;
using NicoView.Model.Platform.Speachers.Bouyomichan;
using NicoView.Model.Speech;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace NicoView.Speech
{
    internal class NicoViewSpeechController
    {
        private NicoViewSpeechController() { }
        internal event Action<GetBouyomichanPathEventArgs> GetBouyomichanPath;

        internal static readonly NicoViewSpeechController Current = new NicoViewSpeechController();

        public bool BouyomichanPathSetRequest()
        {
            var args = new GetBouyomichanPathEventArgs();
            if (GetBouyomichanPath != null)
            {
                
                 GetBouyomichanPath(args);
                

                return true;
            }
            return false;
        }

        internal  void Initialize()
        {
            BouyomichanSpeacher.GetBouyomichanPath += () =>
            {
                if (!BouyomichanPathSetRequest())
                {
                    return NicoViewApplication.Current.Property.BouyomichanPath;
                }
                else
                {
                    return "";
                }
                
            };

            
        }
    }
}
